﻿using System.ComponentModel;
using System.Windows.Forms;
using DataAccessLayer;

namespace Playground
{
    public partial class Playground : Form
    {
        private readonly IPlaygroundPresenter presenter;

        public Playground()
        {
            InitializeComponent();

            presenter = new PlaygroundPresenter(this);
        }

        public void BindModel(BindingList<Protagonist> source)
        {
            dgvProtagonists.DataSource = source;
        }

        private void dgvProtagonists_MouseClick(object sender, MouseEventArgs e)
        {
            dgvProtagonists.BeginEdit(false);
            presenter.AddProtagonist();
            dgvProtagonists.EndEdit();
        }
    }
}